package com.grass.p019lv.dialog;

import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import com.androidsa.bttsddka.R;
import com.androidx.p013lv.base.APPLink;
import com.androidx.p013lv.base.glide.GlideUtils;
import com.androidx.p013lv.base.utils.SpUtils;
import com.grass.p019lv.bean.ActivityBean;

/* renamed from: com.grass.lv.dialog.DialogActivity */
public class DialogActivity extends Dialog {
    ActivityBean activityBean;
    APPLink appLink;
    ImageView iv_activity;
    ImageView iv_dismiss;

    public DialogActivity(Context context, final ActivityBean activityBean2) {
        super(context, R.style.ForceUpdateAppDialog);
        setContentView(R.layout.dialog_activity);
        this.activityBean = activityBean2;
        Window window = getWindow();
        WindowManager.LayoutParams attributes = window.getAttributes();
        attributes.width = -1;
        attributes.height = -1;
        window.setAttributes(attributes);
        setCancelable(false);
        setCanceledOnTouchOutside(false);
        ImageView imageView = (ImageView) findViewById(R.id.iv_activity);
        this.iv_activity = imageView;
        imageView.setOnClickListener(new View.OnClickListener() {
            /* class com.grass.p019lv.dialog.DialogActivity.View$OnClickListenerC29731 */

            public void onClick(View view) {
                DialogActivity.this.dismiss();
                if (activityBean2.getJumpType() == 2) {
                    try {
                        Intent intent = new Intent();
                        intent.setAction("android.intent.action.VIEW");
                        intent.setData(Uri.parse(activityBean2.getActUrl()));
                        DialogActivity.this.getContext().startActivity(intent);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                } else {
                    if (DialogActivity.this.appLink == null) {
                        DialogActivity dialogActivity = DialogActivity.this;
                        dialogActivity.appLink = new APPLink(dialogActivity.getContext());
                    }
                    DialogActivity.this.appLink.urlLink(activityBean2.getActUrl());
                }
            }
        });
        GlideUtils.loadVideo(SpUtils.getInstance().getString("domain") + activityBean2.getAltPicture(), this.iv_activity);
        ImageView imageView2 = (ImageView) findViewById(R.id.iv_dismiss);
        this.iv_dismiss = imageView2;
        imageView2.setOnClickListener(new View.OnClickListener() {
            /* class com.grass.p019lv.dialog.DialogActivity.View$OnClickListenerC29742 */

            public void onClick(View view) {
                DialogActivity.this.dismiss();
            }
        });
        findViewById(R.id.dialog_loading_view).setOnClickListener(new View.OnClickListener() {
            /* class com.grass.p019lv.dialog.DialogActivity.View$OnClickListenerC29753 */

            public void onClick(View view) {
                DialogActivity.this.dismiss();
            }
        });
    }
}
